Skip to content

feat: Always stream INP and remove standalone v1 spans#22517

Open
logaretm wants to merge 3 commits into
developfrom
awad/inp-always-v2-span
Open

feat: Always stream INP and remove standalone v1 spans#22517
logaretm wants to merge 3 commits into
developfrom
awad/inp-always-v2-span

Conversation

@logaretm

@logaretm logaretm commented Jul 22, 2026

Copy link
Copy Markdown
Member

INP is now always emitted as a v2 web vital span. With span streaming enabled it rides the streaming pipeline as before. With span streaming disabled (traceLifecycle: 'static') INP overrides the static lifecycle for itself and still streams, because it reports late and would otherwise be dropped as a late child with nothing to carry it.

The bundle size increase is due to the bytes that now have to live in core without being tree-shaken which re-uses some of the stuff gen_ai uses to send out independent v2 spans. It's only a few bytes, the browser bundle savings are more significant.

Note that there is still a bunch of standalone references, those are needed to skip the span from becoming its own transaction in static lifecycles, it can be removed once we drop those in v12.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.8 kB +0.05% +13 B 🔺
@sentry/browser - with treeshaking flags 26.24 kB +0.07% +17 B 🔺
@sentry/browser (incl. Tracing) 46.4 kB +0.18% +83 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 47.31 kB -1.58% -755 B 🔽
@sentry/browser (incl. Tracing, Profiling) 51.16 kB +0.08% +39 B 🔺
@sentry/browser (incl. Tracing, Replay) 85.72 kB +0.16% +136 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.36 kB +0.17% +126 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 90.43 kB +0.16% +140 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 103.07 kB +0.1% +97 B 🔺
@sentry/browser (incl. Feedback) 44.97 kB +0.03% +13 B 🔺
@sentry/browser (incl. sendFeedback) 32.6 kB +0.04% +11 B 🔺
@sentry/browser (incl. FeedbackAsync) 37.65 kB +0.03% +9 B 🔺
@sentry/browser (incl. Metrics) 28.89 kB +0.04% +11 B 🔺
@sentry/browser (incl. Logs) 29.12 kB +0.05% +13 B 🔺
@sentry/browser (incl. Metrics & Logs) 29.82 kB +0.07% +19 B 🔺
@sentry/react 29.6 kB +0.04% +11 B 🔺
@sentry/react (incl. Tracing) 48.72 kB +0.25% +118 B 🔺
@sentry/vue 33.76 kB +1.64% +543 B 🔺
@sentry/vue (incl. Tracing) 48.38 kB +0.2% +92 B 🔺
@sentry/svelte 27.82 kB +0.04% +11 B 🔺
CDN Bundle 30.12 kB +0.05% +13 B 🔺
CDN Bundle (incl. Tracing) 47.56 kB -1.21% -578 B 🔽
CDN Bundle (incl. Logs, Metrics) 31.71 kB +0.05% +13 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 48.93 kB -1.1% -540 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) 70.97 kB +0.02% +11 B 🔺
CDN Bundle (incl. Tracing, Replay) 85.17 kB -0.65% -549 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.48 kB -0.61% -525 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 90.94 kB -0.6% -548 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.24 kB -0.58% -537 B 🔽
CDN Bundle - uncompressed 89.8 kB +0.04% +27 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 142.71 kB -1.47% -2.13 kB 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.51 kB +0.03% +27 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.69 kB -1.44% -2.13 kB 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.27 kB +0.02% +27 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.97 kB -0.8% -2.11 kB 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.93 kB -0.79% -2.11 kB 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.67 kB -0.76% -2.11 kB 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.63 kB -0.75% -2.11 kB 🔽
@sentry/nextjs (client) 51.27 kB +0.26% +131 B 🔺
@sentry/sveltekit (client) 46.85 kB +0.22% +99 B 🔺
@sentry/core/server 79.45 kB -0.6% -474 B 🔽
@sentry/core/browser 51.41 kB -0.95% -488 B 🔽
@sentry/node 124.17 kB -0.19% -226 B 🔽
@sentry/node (incl. diagnostics channel injection) 149.65 kB -0.13% -182 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 70.03 kB - -
@sentry/node - without tracing 74.52 kB -0.18% -134 B 🔽
@sentry/aws-serverless 83.94 kB -0.22% -182 B 🔽
@sentry/cloudflare (withSentry) - minified 195.53 kB -0.55% -1.08 kB 🔽
@sentry/cloudflare (withSentry) 480.76 kB -0.46% -2.21 kB 🔽

View base workflow run

@logaretm logaretm changed the title feat(browser): Always send INP as a v2 web vital span feat: Always stream INP and remove standalone v1 spans Jul 22, 2026
INP is now always emitted as a v2 web vital span. With span streaming enabled it
rides the streaming pipeline; with streaming disabled it overrides the static
trace lifecycle for itself and still streams (sent directly via `captureSpan` +
`createStreamedSpanEnvelope`, since it is a single span per interaction), because
it reports late and would otherwise be dropped.

INP was the last user of the standalone v1 span mechanism, so that is removed
entirely: the `experimental.standalone` option, the `_isStandaloneSpan` handling
and self-send path in `SentrySpan`, the `createSpanEnvelope` wire format, and the
`SpanEnvelope`/`SpanItem` types and their exports from `@sentry/core` and
`@sentry/types`.

Also dedupes the v2 `SpanContainerItem` construction shared by
`createStreamedSpanEnvelope` and gen_ai span extraction into `createSpanContainerItem`.
@logaretm
logaretm force-pushed the awad/inp-always-v2-span branch from e956bd9 to 8fb2e6d Compare July 23, 2026 13:26
@logaretm
logaretm marked this pull request as ready for review July 23, 2026 14:18
@logaretm
logaretm requested a review from a team as a code owner July 23, 2026 14:18
@logaretm
logaretm requested review from Lms24 and msonnb and removed request for a team July 23, 2026 14:18
Comment thread packages/browser-utils/src/metrics/webVitalSpans.ts Outdated
Comment thread packages/core/src/shared-exports.ts
Comment thread packages/browser-utils/src/metrics/webVitalSpans.ts Outdated
…e attribute

- MIGRATION.md: note the removal of `createSpanEnvelope` and the `SpanEnvelope` /
  `SpanItem` types from `@sentry/core`.
- E2E: assert `browser.web_vital.inp.value` on the INP span (the new payload field)
  in the react-17 / react-router-6 / react-router-7-spa / react-router-8-spa apps.
@logaretm
logaretm requested review from a team as code owners July 23, 2026 20:44
@logaretm
logaretm requested review from JPeer264, chargome, isaacs and nicohrubec and removed request for a team July 23, 2026 20:44

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bd7695f. Configure here.

Comment thread packages/browser-utils/src/metrics/webVitalSpans.ts
Comment thread packages/core/src/tracing/sentrySpan.ts
Comment thread packages/core/src/tracing/idleSpan.ts
Under the static (transaction) trace lifecycle, force-streaming the INP
span made it an ordinary tree span, so it was also swept into the
pageload transaction (or emitted as its own transaction when parentless),
double-sending INP.

Reinstate a per-span standalone flag in core that sends the span on its
own as a v2 streamed span and excludes it from transaction assembly. INP
sets the flag when span streaming is disabled. Every piece of the
mechanism is tagged with a TODO(standalone) marker for removal once the
static trace lifecycle is dropped and every span streams on its own.
@logaretm
logaretm force-pushed the awad/inp-always-v2-span branch from 96516ba to 09e3cbd Compare July 23, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant